#!/bin/bash
# filename:running.sh
# 查询 是否含有进程 scrapy_dongchedi_production ，如果存在就杀掉！然后重启
# nohup bash run_pinterest.sh >bashhis.log &

seconds=7200
echo $seconds
while true
do
  echo $i
  str=`ps aux | grep "pinterest_crawler" | grep -v grep | awk '{print $2}'`
  echo $str Manager
  `kill -9 $str`
  if [ "$?" -eq 0 ]; then
      echo "kill success"
  else
      echo "kill failed"
  fi

  nohup python  pinterest_crawler.py > nohup_pinterest_crawler.log 2>&1 &

  sleep  ${seconds}
done
